import { _decorator, Animation, Component, Node } from 'cc';
import { CardListUI } from './CardListUI';
const { ccclass, property } = _decorator;

type Action<T>=(arg:T)=>void;

@ccclass('PrepareUI')
export class PrepareUI extends Component {
    private anim: Animation;
    onComplete: Action<void>;
    @property(CardListUI)
    cardListUI:CardListUI

    protected start(): void {
        this.anim = this.getComponent(Animation);
        this.anim.enabled=false;
    }
    show(oncomplete:Action<void>){
        this.onComplete=oncomplete;
        this.anim.enabled=true;
    }
    onShowComplete(){
        this.anim.enabled=false;
        this.onComplete?.();
    }
    
}


